//
//  DriverMainViewController.h
//  aigo
//
//  Created by Tai Truong on 11/26/12.
//  Copyright (c) 2012 AIGO. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "APIRequester.h"
#import "AIGOMapAnnotationObject.h"
#import "AIGOMapAnnotationView.h"
#import "PersonDataManager.h"
#import "TouchedGestureRecognizer.h"
#import "RequestPopupView.h"

#define INT_DRIVER_PAGE_SIZE_INDEX                                          100
#define TIMER_AUTOMATION_UPDATE_DRIVER                                      5

typedef enum {
    enumDriverMainStatus_Invalid,
    enumDriverMainStatus_PickUpThisClient,
    enumDriverMainStatus_PickingUpClient,
    enumDriverMainStatus_NotifyYourArrival,
    enumDriverMainStatus_WaitingForClientArrival,
    enumDriverMainStatus_BeginTrip,
    enumDriverMainStatus_FinishTrip
}enumDriverMainStatus;

typedef enum {
    enumDriverSeatsStatus_Invalid,
    enumDriverSeatsStatus_4Seats,
    enumDriverSeatsStatus_8Seats,
    enumDriverSeatsStatus_All
}enumDriverSeatsStatus;

@interface DriverMainViewController : UIViewController <APIRequesterProtocol, CLLocationManagerDelegate, MKMapViewDelegate, TouchedGestureRecognizerProtocol, RequestPopupViewDelegate> {
    APIRequester                            *_APIRequester;
    APIRequester                            *_APIRequesterAutomation;
    
    CFAbsoluteTime                          _updateDriverTimer;
    enumDriverSeatsStatus                   _seatsStatus;
    
    CGRect                                  _frameListButton1;
    CGRect                                  _frameListButton2;
    CGRect                                  _frameListButton3;
    
    PersonNodeData                          *_selectedDriver;
    
    CLLocationCoordinate2D                  _centralPoint;
    float                                   _radiusMeters;
    
    BOOL                                    _isRequestAtFirstTime;
    
    TouchedGestureRecognizer                *_touchedGestureRecognizer;
    
    NSMutableDictionary                     *_remoteNotification;
    
    NSString                                *_amountBilling;
}
@property (weak, nonatomic) IBOutlet MKMapView *mapViewDriver;
@property (weak, nonatomic) IBOutlet UILabel *lblDriverAddress;
@property (strong, nonatomic) IBOutlet UIView *viewListPopup;
@property (weak, nonatomic) IBOutlet UIButton *btnNotifyYourArrival;
@property (weak, nonatomic) IBOutlet UIButton *btnCallYourClient;
@property (weak, nonatomic) IBOutlet UIButton *btnCancelThisTransaction;
@property (weak, nonatomic) IBOutlet UILabel *lblDriverName;
@property (weak, nonatomic) IBOutlet UIView *viewDriverInterface;
@property (weak, nonatomic) IBOutlet UIView *viewDistanceInterface;
@property (weak, nonatomic) IBOutlet UIButton *btn8Seats;
@property (weak, nonatomic) IBOutlet UIButton *btn4Seats;
@property (weak, nonatomic) IBOutlet UIView *viewMapInterface;
@property (weak, nonatomic) IBOutlet UIButton *btnBeginTrip;
@property (weak, nonatomic) IBOutlet UIButton *btnFinishTrip;

- (IBAction)touchUpInsideSetting:(id)sender;
- (IBAction)touchUpInsideList:(id)sender;
- (IBAction)touchUpInsideHideList:(id)sender;
- (IBAction)touchUpInsideSeatsButton:(id)sender;
- (IBAction)touchUpInsideListButton:(id)sender;
- (void)didReceiveRemoteNotification:(NSDictionary*)userInfo andNotificationType:(enumRemoveNotificationType)type;

@end
